package com.nowcoder.code.lcof;

public class JZ81 {


    public int[] reOrderArrayTwo (int[] array) {

        int j = 0;
        int o = array.length - 1;

        while (j < o) {

            while (j < o && array[o] % 2 != 1) {
                o--;
            }
            while (j < o && array[j] % 2 == 1) {
                j++;
            }

            if (j < o) {
                int tmp = array[o];
                array[o] = array[j];
                array[j] = tmp;
            }

        }
        return array;

    }
}
